extends MarginContainer

export (PackedScene) var world

var world_instance
var loaded_level

func _on_ButtonLevel1_pressed():
	var savedata = get_node("/root/Save").get_node_data_by_name("World")
	#print (savedata)
	#print ("loading level from menu")
	if savedata != null:

		var savedata_values = savedata.values()[0].values()
	
		get_node("/root/global").loadLevel("res://Scenes/World.tscn", savedata_values[0], savedata_values[1], false)
	else:
		get_node("/root/global").loadLevel("res://Scenes/World.tscn", "res://Scenes/Maps/LSCurvyCliff/Main_LSCurvyCliff.tscn", null, false)
	




func _on_ButtonExit_pressed():
	get_tree().quit()
	
func _on_ButtonOptions_pressed():
	get_node("/root/global").changeToCustomScene("res://Scenes/UI/OptionsMenu.tscn")
